import request from '@/utils/request'

export const categoriesApi = (obj) => {
  return request('/categories', {
    params: obj
  })
}

export const attributesApi = (id, sel) => {
  return request(`/categories/${id}/attributes`, {
    params: {
      sel: sel
    }
  })
}

export const TagApi = (id, id2, data) => {
  return request.put(`categories/${id}/attributes/${id2}`, data)
}

export const delCategories = (id, attrid) => {
  return request.delete(`categories/${id}/attributes/${attrid}`)
}

export const addCategories = (id, data) => {
  return request.post(`categories/${id}/attributes`, data)
}

export const editCategories = (id, attrId, data) => {
  return request.put(`categories/${id}/attributes/${attrId}`, data)
}